package com.hs.sfzy.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @description:课程实体
 * @author: 陈千鱼不是鱼
 * @date: 2024/10/24 14:32
 **/

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Course {
  private Long id;
  private String courseName;
  private String tabularChart;
  private String couseTime;
  private Long courseMount;
  private String courseIntroduce;
  private String applicablePopulation;
  private Long typeId;
  private String learnHarvest;
  private String subscriptionNotice;
  private Long collects;
  private Long teacherId;
  private String courseVideo;
  private Long pjCount;
  private Double price;
  private Double grade;
  // 收藏本课程的userid数组
  private Integer [] userid;

  public void setGrade(Double grade) {
    if (grade == null) this.grade = 0.0;
    else this.grade = grade;
  }

  public void setPrice(Double price) {
    if (price == null) this.price = 0.0;
    else this.price = price;
  }

  public void setCollects(Long collects) {
    if (collects == null) this.collects = 0L;
    else this.collects = collects;
  }

  public void setCourseMount(Long courseMount) {
    if (courseMount == null) this.courseMount = 0L;
    else this.courseMount = courseMount;
  }

  public void setPjCount(Long pjCount) {
    if (pjCount == null) this.pjCount = 0L;
    else this.pjCount = pjCount;
  }
  // 该课程的评价数
  private Integer coursemarkcount;
  // 该课程收藏数
  private Integer usercoursecount;
}
